﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sealight.Core.Domain
{
   public class UserSessionEntity:BaseEntity
    {
        /// <summary>
        /// Gets or sets the customer session identifier
        /// </summary>
        public virtual Guid UserSessionID { get; set; }

        /// <summary>
        /// Gets or sets the customer identifier
        /// </summary>
        public virtual UserEntity User { get; set; }

        /// <summary>
        /// Gets or sets the last accessed date and time
        /// </summary>
        public virtual DateTime LastAccessed { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the customer session is expired
        /// </summary>
        public virtual bool IsExpired { get; set; }

        public virtual Sealight.Core.DataAdapter.user_session ToDataAdapter()
        {
            return new DataAdapter.user_session {
            id = this.UserSessionID, is_expired=this.IsExpired, last_accessed = this.LastAccessed, user=this.User.ToDataAdapter()            
            };
        }
    }
}
